﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Mahanet.Abyss.PathCalculation
{
	public static class PrecisionUtils
	{
		public static double EPSILON = 0.0000001;

		public static bool IsZero(double a)
		{
			return Math.Abs(a) < EPSILON;
		}

		public static bool AreEqual(double a, double b)
		{
			return IsZero(a - b);
		}

		public static bool AreEqual(Coordinate3D a, Coordinate3D b)
		{
			return AreEqual(a.X, b.X) && AreEqual(a.Y, b.Y) && AreEqual(a.Z, b.Z);
		}
	}
}
